package com.wyl.auth.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description 系统用户
 * @Author WuYiLong
 * @Date 2024-12-21
 */
@Data
@TableName("sys_user")
@Entity
@Table(name="sys_user")
@org.hibernate.annotations.Table(appliesTo = "sys_user",comment = "系统用户")
public class SysUser extends Model<SysUser> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(columnDefinition = "bigint comment '主键id'")
    private Long id;

    @Column(columnDefinition = "varchar(200) comment '用户名'")
    private String username;

    @Column(columnDefinition = "varchar(200) comment '密码'")
    private String password;

    @Column(columnDefinition = "varchar(200) comment '手机号'")
    private String phone;

    @Column(columnDefinition = "varchar(200) comment '邮箱'")
    private String email;

    @Column(columnDefinition = "int comment '是否删除？0否，1是'")
    private Integer deleted;

    @Column(columnDefinition = "bigint comment '创建人用户id'")
    private Long createUserId;

    @Column(columnDefinition = "bigint comment '更新人用户id'")
    private Long updateUserId;

    @Column(columnDefinition = "datetime(6) comment '创建时间'")
    private LocalDateTime createTime;

    @Column(columnDefinition = "datetime(6) comment '更新时间'")
    private LocalDateTime updateTime;

    @Column(columnDefinition = "tinyint comment '性别'")
    private Integer sex;

    @Column(columnDefinition = "varchar(255) comment '头像'")
    private String avatar;

    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
